<div class="content">

	<div class="header">
		<div class="page-title">
                    <div>
                        <h1><i class="icon-file-alt"></i> <?php echo $box_title; ?></h1>
                        <h4>Thông tin mới cập nhật</h4>
                    </div>
        </div>		
	</div>

	<div class="container-fluid">
		<div class="row-fluid">
		
			<div class="btn-toolbar text-right">
			</div>
			
			
            <!-- BEGIN Main Content -->
            			
				<div class="row-fluid">
                    <div class="span12">
                        <div class="box">
                            <div class="box-title">
                                <h3><i class="icon-folder-close"></i>Thông tin mới cập nhật</h3>
                                <ul class="nav nav-tabs">
                                    <li id="question-tab" class="active btntab"><a data-toggle="tab" href="#tab-1-1">Những Câu Hỏi Mới (<?php echo count($rsQuestion); ?>)</a></li>
                                    <li id="comment-tab" class="btntab"><a data-toggle="tab" href="#tab-1-2">Comment Mới Post (<?php echo count($rsComment); ?>)</a></li>
                                </ul>
                            </div>

                            <div class="box-content">
                                <div class="tab-content">
                                    <div id="tab-1-1" class="tab-pane active">
                                    
                                    
								<table class="table table-striped table-hover fill-head">
                                    <thead>
                                        <tr>
                                            <th width="2%">#</th>
                                            <th width="3%"></th>
                                            <th>Question</th>
                                            <th style="text-align: center" width="60px">Active</th>
                                            <th style="width: 70px">Action</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                    
                                    <?php
                                    	$i = 1; 
                                    	foreach ($rsQuestion as $rowQuestion) :
                                    ?>
                                    
									<tr>
										<td><?php echo $i; ?></td>
										<td></td>
                                        <td>
                                        	<?php echo h($rowQuestion["question"]); ?>
                                        	<br><br>
                                        	<span class="time"><i class="icon-time"></i> <?php echo $rowQuestion['create_at']; ?></span>
                                        </td>
                                        
                                        <td style="text-align: center">
                                            <?php if ($rowQuestion['active'] == 1) : ?>
                                            	<a href='#' title='Active' class='btn btn-circle btn-lime'><i class="icon-ok-sign"></i></a>
                                            <?php else : ?>
                                            	<a href='#' title='UnActive' class='btn btn-circle btn-gray'><i class="icon-remove-circle"></i></a>
                                            <?php endif; ?>                                            
                                        </td>
										
										<td>	
											<div class="btn-group">
												<a class="btn btn-small btn-gray" title="" href="<?php echo site_url("amway/question/edit/{$rowQuestion['id']}")?>"><i class="icon-edit"></i></a>		
												<a class="btn btn-small btn-danger" title="" href="javascript:confimDelete('<?php echo site_url("amway/question/delete/{$rowQuestion['id']}")?>');"><i class="icon-trash"></i></a>	
											</div>
										</td>
									</tr>                                    
                                    
                                    <?php
                                    		$i++; 
                                    	endforeach; 
                                    ?>
                                        
                                    </tbody>
                                </table>
                                        
                                    </div>
                                    <div id="tab-1-2" class="tab-pane">
                                    
                                <ul class="messages">
                                
                                    <?php
                                    	foreach ($rsComment as $rowComment) :
                                    		$active_link = site_url('amway/comment/active/'.$rowComment['question_id'].'/'.$rowComment['id'].'/1?return_url=amway/dashboard/show/comment-tab');
                                    ?>
                                
                                    <li>
<!--                                         <img alt="" src="https://fbcdn-profile-a.akamaihd.net/hprofile-ak-ash1/t1.0-1/c71.0.579.579/s50x50/250107_10100350563924029_1315140_n.jpg"> -->
                                        <img src="http://graph.facebook.com/<?php echo $rowComment['fbid']; ?>/picture">
                                        <div>
                                            <div>
                                                <h5 class="<?php echo ($rowComment['active'] == 1 ? "green" : "red"); ?>">David</h5>
                                                <span class="time"><i class="icon-time"></i> <?php echo h($rowComment["create_at"]); ?></span>
                                            </div>
                                            <p><?php echo h($rowComment["content"]); ?></p>
                                            
											<div class="messages-actions">
                                                <a title="" href="<?php echo $active_link; ?>" class="show-tooltip" data-original-title="Approve">
                                                	<i class="icon-ok green"></i>
                                                </a>
                                                <a title="" href="<?php echo site_url('amway/comment/edit/'.$rowComment['question_id'].'/'.$rowComment['id']); ?>" class="show-tooltip" data-original-title="Edit">
                                                	<i class="icon-edit orange"></i>
                                                </a>                                                
												<a href="javascript:confimDelete('<?php echo site_url("amway/comment/delete/{$rowComment['question_id']}/{$rowComment['id']}")?>');" title='' class="show-tooltip" data-original-title="Remove">
                                                	<i class="icon-trash gray"></i>
                                                </a>
                                            </div>                                            
                                            
                                        </div>
                                    </li>
                                    
                                    <?php endforeach; ?>
                                    
                                </ul>
                                                                    
                                                                        
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>			

			<!-- END Main Content -->			
                			
			
		</div>
	</div>
</div>


<script type="text/javascript">
                                    
$(document).ready(function() {
	$('.nav-tabs li#<?php echo $defautl_tab; ?> a').click();	
});
                                    
</script>

